
const request = require('../../../utils/request');

Page({
    data:{
        userId:0
    },
    onLoad(e) {
        
        if(e.userId){
            this.setData({
                userId:e.userId
            })
        }
    },
    getUserInfo: function(e) {
        console.log(e);
        let user={
            'userHeaderUrl': e.detail.userInfo.avatarUrl,
            'userName': e.detail.userInfo.nickName
        }
        let that = this;
        wx.setStorage({
            key: 'user',
            data: user,
            success: function(){
                request.myLogin(that.data.userId);
            }
        })
    },
    // toLogin() {
    //     request.myLogin(this.data.userId);
    // },
    
})